package com.haoran.dwz.domain.entities;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.UpdateTimestamp;
import org.springframework.format.annotation.DateTimeFormat;

@Entity
@IdClass(UserPersonalizationPK.class)
@Table(name = "t_personalization_setting")
public class PersonalizationSetting implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@Id
	private String userId;
	@Id
	private String personalizationId;
	
	public String getUserId() {
		return userId;
	}
	
	private String value;
	
	@Column(name = "create_time")
	@Temporal(TemporalType.TIMESTAMP)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	protected Date createTime = new Date();

	@Column(name = "update_time")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Temporal(TemporalType.TIMESTAMP)
	@UpdateTimestamp
	protected Date updateTime;
	
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getPersonalizationId() {
		return personalizationId;
	}
	public void setPersonalizationId(String personalizationId) {
		this.personalizationId = personalizationId;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}

}
